package com.zx.yixun.util;

import java.util.concurrent.Executors;

import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

public class RxSchedulers {
    public static final Scheduler database = Schedulers.single();
    public static final Scheduler io = Schedulers.io();
    public static final Scheduler ui = AndroidSchedulers.mainThread();
    public static Scheduler mScheduler;
    public static Scheduler getScheduler() {
        if (mScheduler == null) {
            synchronized (RxSchedulers.class) {
                if (mScheduler == null) {
                    mScheduler = Schedulers.from(Executors.newFixedThreadPool(15));
                }
            }
        }
        return mScheduler;
    }
}
